import java.util.Scanner;

public class UsersType extends Users implements way{
    private String customertype;
    private String viptype;

    @Override
    public String toString() {
        return "UsersType{" +
                "customertype='" + customertype + '\'' +
                ", viptype='" + viptype + '\'' +
                '}';
    }

    public void setCustomertype(String customertype) {
        this.customertype = customertype;
    }

    public void setViptype(String viptype) {
        this.viptype = viptype;
    }

    public String getCustomertype() {
        return customertype;
    }

    public String getViptype() {
        return viptype;
    }

    @Override
    public void land(String account, String password) {
        UsersType s = new UsersType();
        s.setAccount(account);
        s.setPassword(password);
        System.out.println("请选择用户账号类型：(普通用户或企业用户)");
        UsersType x1=new UsersType();
        x1.setCustomertype("普通用户");
        UsersType x2=new UsersType();
        x2.setCustomertype("企业用户");
        Scanner a = new Scanner(System.in);
        String b =a.next();
        switch (b){
            case "普通用户":
                if(account=="zhangsan"&&password=="123") {
                    System.out.println("登陆成功");
                    System.out.println("请选择您要购买的商品：（Arts or Books or Phone)");
                    Goods goods = new Goods();
                    Scanner g = new Scanner(System.in);
                    String g1 = g.next();
                    switch (g1) {
                        case "Arts":
                            goods.setPrice(50000);
                            break;
                        case "Books":
                            goods.setPrice(50);
                            break;
                        case "Phone":
                            goods.setPrice(5000);
                            break;
                    }
                    System.out.println("请输入您要购买的数量：");
                    Scanner num = new Scanner(System.in);
                    int nums = num.nextInt();
                    System.out.println("请选择您的会员类型：（普通会员或年度会员）");
                    Scanner j = new Scanner(System.in);
                    String k = a.next();
                    switch (k) {
                        case "普通会员":
                            s.settlement(nums, goods.getPrice());
                            break;
                        case "年度会员":
                            s.settlement(nums, goods.getPrice(), b);
                    }
                }
                else
                    System.out.println("您的用户名或密码错误");
                break;
            case "企业用户":
                if (account=="lisi"&&password=="456") {

                    System.out.println("登陆成功");
                    System.out.println("请选择您要购买的商品：（Arts or Books or Phone)");
                    Goods goods = new Goods();
                    Scanner g = new Scanner(System.in);
                    String g1 = g.next();
                    switch (g1) {
                        case "Arts":
                            goods.setPrice(50000);
                            break;
                        case "Books":
                            goods.setPrice(50);
                            break;
                        case "Phone":
                            goods.setPrice(5000);
                            break;
                    }
                    System.out.println("请输入您要购买的数量：");
                    Scanner num = new Scanner(System.in);
                    int nums = num.nextInt();
                    System.out.println("请选择您的会员类型：（普通会员或年度会员）");
                    Scanner j = new Scanner(System.in);
                    String k = a.next();
                    switch (k) {
                        case "普通会员":
                            s.settlement(nums, goods.getPrice());
                            break;
                        case "年度会员":
                            s.settlement(nums, goods.getPrice(), k);
                    }
                }
                else System.out.println("您的用户名或密码错误");
                break;
        }
    }

    @Override
    public void settlement(int a,double b) {
        System.out.println("您是普通会员");
        Goods c=new Goods();
        c.setPrice(b);
        System.out.println("您总共消费："+a*(c.getPrice())*0.9);
    }

    @Override
    public void settlement(int a,double x,String b) {
        System.out.println("您是"+b);
        Goods c=new Goods();
        c.setPrice(x);
        System.out.println("您总共消费："+a*(c.getPrice())*0.75);
    }
}
